
import java.util.ListIterator;
/**
 * Snashot populacji w danym pokoleniu
 * @author pawel
 *
 */
public class populationSnapshot {
private double average;
private double deviation;
private osobnik best;
/*
 * Wartosci hromosomow wszystkich osobnikow
 */
private double[] individuals;
private long generation;
public populationSnapshot(populacja popul, long generation) {
	this.average	= popul.getAverage();
	this.deviation	= popul.getDeviation();
	this.best		= new osobnik(popul.getBest());
	this.generation = generation;
	int i=0;
	if( ! popul.getPopul().isEmpty()){
		this.individuals = new double[popul.getPopul().size()];
		ListIterator<osobnik> iter = popul.getPopul().listIterator();
		while(iter.hasNext()){
			this.individuals[i++] = (iter.next()).getFhromosome();
		}
		
		
	}
	
}
public double getAverage() {
	return average;
}
public double getDeviation() {
	return deviation;
}
public osobnik getBest() {
	return best;
}
public double[] getIndividuals() {
	return individuals;
}
public long getGeneration() {
	return generation;
}


}
